package yto.freemarker.springaop.processor;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * 动态代理，对方法的增强
 * @author dongxing
 **/
public class YtoInvationHandler implements InvocationHandler {

    //目标类
    Object target;
    public YtoInvationHandler(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("动态代理！！！");
        return method.invoke(target,args);
    }
}
